import requests
from bs4 import BeautifulSoup
import pandas as pd

def get_weibo_hot():
    url='https://s.weibo.com/top/summary?cate=realtimehot'
    headers = {
        'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3'
    }
    response = requests.get(url, headers=headers)
    response.encoding = 'utf-8'
    soup = BeautifulSoup(response.text, 'html.parser')
    data = soup.find_all('td', class_='td-02')
    hot_list = []
    for i in data:
        hot_list.append(i.a.text)
    return hot_list


def get_douyin_hot():
    url='https://www.iesdouyin.com/share/billboard/?id=0'
    headers = {
        'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3'

    }
    response = requests.get(url, headers=headers)
    response.encoding = 'utf-8'
    soup = BeautifulSoup(response.text, 'html.parser')
    data = soup.find_all('div', class_='text')
    hot_list = []
    for i in data:
        hot_list.append(i.text)
    return hot_list
